<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

    <head>
        <meta charset="utf-8" />
        <title>公告添加</title>
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta content="Premium Multipurpose Admin & Dashboard Template" name="description" />
        <meta content="" name="author" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />

        <!-- App favicon -->
        <link rel="shortcut icon" href="../assets/images/favicon.ico">

        <!-- App css -->
        <link href="../assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="../assets/css/jquery-ui.min.css" rel="stylesheet">
        <link href="../assets/css/icons.min.css" rel="stylesheet" type="text/css" />
        <link href="../assets/css/metisMenu.min.css" rel="stylesheet" type="text/css" />
        <link href="../assets/css/app.min.css" rel="stylesheet" type="text/css" />

    </head>

    <body>

    <!-- Top Bar Start -->
    <div th:replace="~{common/top-nav::top-nav}"></div>
    <!-- Top Bar End -->


    <!-- Left Sidenav -->
    <div th:replace="~{common/left-side-nav::left-side-nav}"></div>
    <!-- end left-sidenav-->

        <div class="page-wrapper">
            <!-- Page Content-->
            <div class="page-content">

                <div class="container-fluid">
                    <!-- Page-Title -->
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="page-title-box">
                                <div class="float-right">
                                    <ol class="breadcrumb">
                                        <li class="breadcrumb-item"><a href="javascript:void(0);">办公自动化</a></li>
                                        <li class="breadcrumb-item"><a href="javascript:void(0);">公告管理</a></li>
                                        <li class="breadcrumb-item active">公告添加</li>
                                    </ol>
                                </div>
                                <h4 class="page-title">添加公告</h4>
                            </div><!--end page-title-box-->
                        </div><!--end col-->
                    </div>
                    <!-- end page title end breadcrumb -->
                    <div class="row">
                        <div class="col-12">
                            <div class="card">
                                <div class="card-body">
                                            <form th:action="@{/notice/notice_add}" method="post"
                                                  class="needs-validation" novalidate>
                                                <!--												novalidate 不让浏览器进行自动验证-->
                                                <div class="form-group row">
                                                    <label for="title"
                                                           class="col-sm-2 col-form-label text-right">标题</label>
                                                    <div class="col-sm-8">
                                                        <!--required 提交表单时进行验证-->
                                                        <input class="form-control" type="text" required maxlength="16"
                                                               th:value="${notice != null ? notice.title : ''}"
                                                               name="title"
                                                               id="title">
                                                        <div class="invalid-feedback">用户名称不能为空，并且不能超过16个字</div>
                                                        <div class="text-danger mt-2" th:text="${errorMessages != null and errorMessages.containsKey('title') ?  errorMessages.title : ''}">错误信息</div>
                                                    </div>
                                                </div>
                                                <div class="form-group row">
                                                    <label for="content"
                                                           class="col-sm-2 col-form-label text-right">内容</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" type="text" value="" required maxlength="8" minlength="6"
                                                               name="content" th:value="${notice != null ? notice.content : ''}"
                                                               id="content">
                                                        <div class="invalid-feedback">用户密码不能为空，不能超过8位，小于6位</div>
                                                        <div class="text-danger mt-2" th:text="${errorMessages != null and errorMessages.containsKey('content') ?  errorMessages.content : ''}">错误信息</div>
                                                    </div>
                                                </div>
                                                <div class="form-group row">
                                                    <label for="adminId"
                                                           class="col-sm-2 col-form-label text-right">管理员id</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" type="text" value="" required
                                                               name="level" th:value="${notice != null ? notice.adminId : ''}"
                                                               id="adminId">
                                                        <div class="invalid-feedback">用户等级不能为空</div>
                                                        <div class="text-danger mt-2" th:text="${errorMessages != null and errorMessages.containsKey('adminId') ?  errorMessages.adminId : ''}">错误信息</div>
                                                    </div>
                                                </div>
                                                <div class="form-group row">
                                                    <label for="releaseTime"
                                                           class="col-sm-2 col-form-label text-right">发布时间</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" type="text" value="" required
                                                               name="releaseTime" th:value="${notice != null ? notice.adminId : ''}"
                                                               id="releaseTime">
                                                        <div class="invalid-feedback">用户等级不能为空</div>
                                                        <div class="text-danger mt-2" th:text="${errorMessages != null and errorMessages.containsKey('releaseTime') ?  errorMessages.releaseTime : ''}">错误信息</div>
                                                    </div>
                                                </div>
                                                <div class="row">
                                                    <div class="col-sm-10 ml-auto">
                                                        <button type="submit"
                                                                class="btn btn-gradient-primary">保存</button>
                                                        <button type="reset"
                                                                class="btn btn-gradient-danger">重置</button>
                                                    </div>
                                                </div>
                                            </form>

                                  <!--end table-->
                                </div><!--end card-body-->
                            </div><!--end card-->
                        </div> <!-- end col -->
                    </div> <!-- end row -->



                </div><!-- container -->

                <footer class="footer text-center text-sm-left">
                    &copy; 2022办公自动化 <span class="text-muted d-none d-sm-inline-block float-right"><i class="mdi mdi-heart text-danger"></i> 来自 <a href="#">4228</a></span>
                </footer><!--end footer-->
            </div>
            <!-- end page content -->
        </div>
        <!-- end page-wrapper -->

        


        <!-- jQuery  -->
        <script src="../assets/js/jquery.min.js"></script>
        <script src="../assets/js/jquery-ui.min.js"></script>
        <script src="../assets/js/bootstrap.bundle.min.js"></script>
        <script src="../assets/js/metismenu.min.js"></script>
        <script src="../assets/js/waves.js"></script>
        <script src="../assets/js/feather.min.js"></script>
        <script src="../assets/js/jquery.slimscroll.min.js"></script>
        
        <script src="../../plugins/tiny-editable/mindmup-editabletable.js"></script>
        <script src="../../plugins/tiny-editable/numeric-input-example.js"></script>
        <script src="../../plugins/bootable/bootstable.js"></script> 
        <script src="../assets/pages/jquery.tabledit.init.js"></script> 

        <!-- App js -->
        <script src="../assets/js/app.js"></script>
    <script>
        // 为表单注册提交事件
        $('form.needs-validation').submit(function (enevt) {
            // 调用表单对象的验证方法。如果验证方法返回true，说明表单所有的域都填写正确。否则返回false
            if (this.checkValidity() === false){
                // 为表单添加注册失败后的样式
                $(this).addClass('was-validated')
                return false;
            }

            return true;
        })
    </script>
    </body>

</html>